﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Customer_Profile.eCardReport.DBDao;
using KVB.Common;
using System.Text;
using Customer_Profile.eCard.DBDao;

namespace Customer_Profile.eCardReport
{
    public partial class Settle_Detail_Report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                txtgedatebegin.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
                txtgedateend.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
            }
            gridResult.OptionsView.DataHeadersDisplayMode = DevExpress.Web.ASPxPivotGrid.PivotDataHeadersDisplayMode.Popup;
            gridResult.OptionsView.ShowFilterHeaders = false;
            gridResult.OptionsView.ShowDataHeaders = false;
            gridResult.OptionsView.ShowColumnHeaders = false;
            gridResult.OptionsView.ShowRowHeaders = false;

            BindDataView();
        }

        private void BindDataView()
        {
            try
            {
                string start_date = txtgedatebegin.Text.Trim();
                string end_date = txtgedateend.Text.Trim();
                DataSet dsResult = ReportDao.Settle_Detail_Report(start_date,end_date);
                if (dsResult != null && dsResult.Tables.Count > 0)
                {
                    gridResult.DataSource = dsResult;
                    gridResult.DataBind();
                }
            }
            catch (Exception ex)
            {
                Log.WriteDefaultLog("Maturity_BindDataView", ex.ToString());
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {

        }

        protected void btn_Export_Click(object sender, EventArgs e)
        {
            ASPxPivotGridExporter1.ExportXlsxToResponse("支付明细表");
        }
    }
}